package com.gears;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import org.apache.log4j.Logger;

public class Constant {
	
	private static Logger  log = Logger.getLogger("ConstantLogger");

	private static String CONFIG_FILE = "parmarter.properties";

	private static final Properties constantMap = new Properties();

	public static final String key_file_folder_path = "file_folder_path";

	public static final String key_convert_tmp_file_path = "convert_tmp_file_path";
	
	static{
		String classPath = new File(Constant.class.getResource("/").getFile()).getPath();
		String configFilePath = classPath + File.separator + CONFIG_FILE;
		InputStream in = Object.class
				.getResourceAsStream(configFilePath);
		try {
			constantMap.load(in);
		} catch (IOException e) {
			log.error("读取配置文件失败", e);
		}
	}
	
	public static Object getConstantVal(String key){
		return  constantMap.get(key);
	}
	
	
}
